home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 80 / CD Actual 80 Julio-Agosto 2003.iso / Linux / LinuxGazette / lg / issue83 / misc / sandeep / Code.S next >
Encoding:
Text File  |  2002-10-01  |  577 b   |  23 lines

  1. /*     This is the injected shellcode        */
  2.  
  3. .globl injected_shellcode
  4.  
  5. injected_shellcode:     /* ret location has been pushed previously    */
  6.     nop
  7.     nop
  8.     pusha           /* save before anything        */
  9.     xor %eax,%eax
  10.     mov $0x02,%al      /* sys_fork            */
  11.     int $0x80       /* fork()            */
  12.     xor %ebx,%ebx
  13.     cmp %eax,%ebx   /* father or son ?        */
  14.     je  son         /* I'm son            */
  15.  
  16. father:         /* I'm the father, I've to restore my previous state */
  17.     popa
  18.     ret         /* Old values restored, Now return     */
  19.             /* code finished for father        */        
  20.  
  21. son:            /* standard shellcode, at your choice     */
  22.     .string ""    
  23.